import javax.swing.JComponent;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;

public class ThreeDButtonComponent extends JComponent
{
   public void paintComponent(Graphics g)
   {
      Graphics2D g2 = (Graphics2D) g;
      // your work here
      Color color1=Color.pink;
      Color color2=color1.brighter();
      Color color3=color1.darker();
      super.paintComponent(g);
      g.setColor(color1);
      g.fillRect(50,50,100,100);
      g.setColor(color2);
      g.fillRect(48,48,102,2);
      g.fillRect(48,50,2,100);
      g.setColor(color3);
      g.fillRect(48,150,102,2);
      g.fillRect(150,48,2,104);
   }
}